package com.cskaoyan.factory;

import com.cskaoyan.bean.Car;
import org.springframework.beans.factory.FactoryBean;

/**
 * FactoryBean
 * XXXFactoryBean → 注册的组件就是XXX
 * @author stone
 * @date 2021/12/25 11:31
 */
public class CarFactoryBean implements FactoryBean<Car> {
    @Override
    public Car getObject() throws Exception {
        Car car = new Car();
        car.setSource("factory bean");
        return car;
    }

    @Override
    public Class<?> getObjectType() {
        return Car.class;
    }
}
